package com.lst.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lst.api.vo.AssetsCarInfoVo;
import com.lst.tools.mybatis.entity.DeleteBaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 资产信息中的车辆信息
 *
 * @author Frank
 * @date 2019-12-30 10:31:37
 * @version: V1.0
 */
@Data
@NoArgsConstructor
@TableName(value = "lst_assets_car_info")
@ApiModel(value = "资产信息中的车辆信息")
public class AssetsCarInfo extends DeleteBaseModel {

    public static final String APPLY_NO = "apply_no";
    public static final String PROMO_USER_ID = "promo_user_id";
    public static final String CAR_BRAND_ID = "car_brand_id";
    public static final String CAR_BUY_AT = "car_buy_at";
    public static final String CAR_BUY_TOTAL_AMOUNT = "car_buy_total_amount";
    public static final String CAR_BUY_TYPE = "car_buy_type";
    public static final String INSURANCE_COMPANY = "insurance_company";
    public static final String INSURANCE_PAY_WAY = "insurance_pay_way";
    public static final String INSURANCE_PAY_AMOUNT = "insurance_pay_amount";

    @ApiModelProperty(name = "applyNo", value = "申请编号", dataType = "String")
    @TableField(value = APPLY_NO)
    private String applyNo;

    @ApiModelProperty(name = "promoUserId", value = "推销员用户id", dataType = "Long")
    @TableField(value = PROMO_USER_ID)
    private Long promoUserId;

    @ApiModelProperty(name = "carBrandId", value = "车品牌id", dataType = "Long")
    @TableField(value = CAR_BRAND_ID)
    private Long carBrandId;

    @ApiModelProperty(name = "carBuyAt", value = "购买车日期", dataType = "Date")
    @TableField(value = CAR_BUY_AT)
    private Date carBuyAt;

    @ApiModelProperty(name = "carBuyTotalAmount", value = "购车总金额", dataType = "Double")
    @TableField(value = CAR_BUY_TOTAL_AMOUNT)
    private Double carBuyTotalAmount;

    @ApiModelProperty(name = "carBuyType", value = "购车方式    0:一次性    1:按揭", dataType = "String")
    @TableField(value = CAR_BUY_TYPE)
    private String carBuyType;

    @ApiModelProperty(name = "insuranceCompany", value = "保险公司", dataType = "String")
    @TableField(value = INSURANCE_COMPANY)
    private String insuranceCompany;

    @ApiModelProperty(name = "insurancePayWay", value = "保险缴费方式    0:月缴    1:年缴", dataType = "String")
    @TableField(value = INSURANCE_PAY_WAY)
    private String insurancePayWay;

    @ApiModelProperty(name = "insurancePayAmount", value = "保险缴纳金额", dataType = "Double")
    @TableField(value = INSURANCE_PAY_AMOUNT)
    private Double insurancePayAmount;


    public AssetsCarInfo(long userId, String applyNo, AssetsCarInfoVo assetsCarInfoVo) {
        this.applyNo = applyNo;
        this.promoUserId = userId;
        this.carBrandId = assetsCarInfoVo.getCarBrandId();
        this.carBuyAt = assetsCarInfoVo.getCarBuyAt();
        this.carBuyTotalAmount = assetsCarInfoVo.getCarBuyTotalAmount();
        this.carBuyType = assetsCarInfoVo.getCarBuyType();
        this.insuranceCompany = assetsCarInfoVo.getInsuranceCompany();
        this.insurancePayWay = assetsCarInfoVo.getInsurancePayWay();
        this.insurancePayAmount = assetsCarInfoVo.getInsurancePayAmount();
    }
}